package com.corona.game;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.audio.Music;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.Pixmap;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.Sprite;
import com.badlogic.gdx.graphics.glutils.ShaderProgram;
import com.badlogic.gdx.math.Matrix4;
import com.badlogic.gdx.math.Quaternion;
import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.math.Vector3;
import com.badlogic.gdx.utils.ScreenUtils;
import com.corona.Game;
import com.corona.game.util.SpriteProxy;
import com.corona.game.util.TextureCache;
import com.corona.game.util.audio.AudioLoader;
import java.util.ArrayList;
import java.util.Locale;

/* compiled from: Battle.java */
/* access modifiers changed from: package-private */
/* loaded from: pokewilds.jar:com/pkmngen/game/Attack.class */
public class Attack {
    String name;
    String effect;
    String type;
    int accuracy;
    int pp;
    int effectChance;
    boolean isPhysical;
    int priority;
    int power;
    int damage;
    boolean isCrit;
    public Category category;

    /* compiled from: Battle.java */
    /* loaded from: pokewilds.jar:com/pkmngen/game/Attack$Category.class */
    public enum Category {
        SPECIAL,
        PHYSICAL,
        STATUS
    }

    public Attack() {
        this.isPhysical = false;
        this.priority = 0;
        this.isCrit = false;
        this.category = null;
    }

    public Attack(Attack attack) {
        this.isPhysical = false;
        this.priority = 0;
        this.isCrit = false;
        this.category = null;
        this.name = attack.name;
        this.effect = attack.effect;
        this.power = attack.power;
        this.type = attack.type;
        this.accuracy = attack.accuracy;
        this.pp = attack.pp;
        this.effectChance = attack.effectChance;
        this.isCrit = attack.isCrit;
        this.damage = attack.damage;
        this.priority = attack.priority;
        this.isPhysical = attack.isPhysical;
        this.category = attack.category;
    }

    public Attack(String name, String effect, int power, String type, int accuracy, int pp, int effectChance) {
        this.isPhysical = false;
        this.priority = 0;
        this.isCrit = false;
        this.category = null;
        this.name = name;
        this.effect = effect;
        this.power = power;
        if (!Game.fairyTypeEnabled && type.equals("FAIRY")) {
            type = "NORMAL";
        }
        this.type = type;
        this.accuracy = accuracy;
        this.pp = pp;
        this.effectChance = effectChance;
        if (this.name.equals("endure") || this.name.equals("protect") || this.name.equals("detect")) {
            this.priority = 2;
        } else if (this.effect.equals("EFFECT_PRIORITY_HIT") || this.name.equals("quick attack") || this.name.equals("mach punch") || this.name.equals("extremespeed")) {
            this.priority = 1;
        } else if (this.name.equals("counter") || this.name.equals("mirror coat") || this.name.equals("whirlwind") || this.name.equals("roar") || this.name.equals("vital throw")) {
            this.priority = -1;
        } else {
            this.priority = 0;
        }
        if (Game.specialPhysicalSplitEnabled) {
            this.category = Battle.specPhysLookup.get(this.name.toLowerCase(Locale.ROOT).replace("_", " "));
            if (this.category == null) {
                System.out.println("WARNING - attack with no category (fix this): " + this.name);
            }
            this.isPhysical = this.category == Category.PHYSICAL;
        } else if (Battle.gen2PhysicalTypes.contains(this.type.toLowerCase(Locale.ROOT))) {
            this.isPhysical = true;
        }
    }

    /* compiled from: Battle.java */
    /* loaded from: pokewilds.jar:com/pkmngen/game/Attack$Default.class */
    public static class Default extends Action {
        Vector2 position;
        ArrayList<Sprite> sprites;
        Sprite sprite;
        ArrayList<Integer> repeats;
        ArrayList<Float> alphas;
        ArrayList<String> sounds;
        String sound;
        Sprite helperSprite;
        int power;
        int accuracy;
        public Action.Layer layer = Action.Layer.gui_120;
        boolean doneYet = false;
        ArrayList<Vector2> positions = new ArrayList<>();

        public Default(Game game, int power, int accuracy, Action nextAction) {
            super(new Object[0]);
            this.power = power;
            this.accuracy = accuracy;
            this.nextAction = nextAction;
            this.position = new Vector2(game.player.currPokemon.backSprite.getX(), game.player.currPokemon.backSprite.getY());
            this.positions.add(new Vector2(8.0f, 0.0f));
            this.positions.add(new Vector2(-8.0f, 0.0f));
            for (int i = 0; i < 13; i++) {
                this.positions.add(new Vector2(0.0f, 0.0f));
            }
            this.sprites = new ArrayList<>();
            for (int i2 = 0; i2 < 15; i2++) {
                this.sprites.add(null);
            }
            this.repeats = new ArrayList<>();
            this.repeats.add(7);
            this.repeats.add(3);
            this.repeats.add(17);
            this.repeats.add(6);
            this.repeats.add(7);
            this.repeats.add(5);
            this.repeats.add(9);
            this.repeats.add(4);
            this.repeats.add(8);
            this.repeats.add(6);
            this.repeats.add(7);
            this.repeats.add(5);
            this.repeats.add(9);
            this.repeats.add(4);
            this.repeats.add(11);
            this.alphas = new ArrayList<>();
            this.alphas.add(Float.valueOf(1.0f));
            this.alphas.add(Float.valueOf(1.0f));
            this.alphas.add(Float.valueOf(1.0f));
            for (int i3 = 0; i3 < 6; i3++) {
                this.alphas.add(Float.valueOf(0.0f));
                this.alphas.add(Float.valueOf(1.0f));
            }
            this.sounds = new ArrayList<>();
            this.sounds.add(null);
            this.sounds.add("tackle1");
            for (int i4 = 0; i4 < 13; i4++) {
                this.sounds.add(null);
            }
        }

        @Override // com.corona.game.Action
        public String getCamera() {
            return "gui";
        }

        @Override // com.corona.game.Action
        public Action.Layer getLayer() {
            return this.layer;
        }

        @Override // com.corona.game.Action
        public void step(Game game) {
            if (this.positions.isEmpty() || this.sprites.isEmpty()) {
                int finalHealth = game.battle.oppPokemon.currentStats.get("hp").intValue() - this.power;
                if (finalHealth < 0) {
                    finalHealth = 0;
                }
                game.battle.oppPokemon.currentStats.put("hp", Integer.valueOf(finalHealth));
                game.insertAction(this.nextAction);
                game.actionStack.remove(this);
                return;
            }
            this.sprite = this.sprites.get(0);
            float currAlpha = this.alphas.get(0).floatValue();
            game.battle.oppPokemon.sprite.setAlpha(currAlpha);
            if (game.battle.oppPokemon.breathingSprite != null) {
                game.battle.oppPokemon.breathingSprite.setAlpha(currAlpha);
            }
            this.sound = this.sounds.get(0);
            if (this.sound != null) {
                game.insertAction(new PlayMusic(this.sound, (Action) null));
                this.sounds.set(0, null);
            }
            if (this.repeats.get(0).intValue() > 1) {
                this.repeats.set(0, Integer.valueOf(this.repeats.get(0).intValue() - 1));
                return;
            }
            this.position = this.position.add(this.positions.get(0));
            game.player.currPokemon.backSprite.setPosition(this.position.x, this.position.y);
            this.positions.remove(0);
            this.sprites.remove(0);
            this.repeats.remove(0);
            this.sounds.remove(0);
            this.alphas.remove(0);
        }
    }

    /* compiled from: Battle.java */
    /* loaded from: pokewilds.jar:com/pkmngen/game/Attack$DefaultEnemy.class */
    public static class DefaultEnemy extends Action {
        Pokemon pokemon;
        Pokemon oppPokemon;
        Vector2 position;
        ArrayList<Sprite> sprites;
        Sprite sprite;
        ArrayList<Integer> repeats;
        ArrayList<Float> alphas;
        ArrayList<String> sounds;
        String sound;
        Sprite helperSprite;
        int power;
        int accuracy;
        public Action.Layer layer = Action.Layer.gui_120;
        boolean doneYet = false;
        ArrayList<Vector2> positions = new ArrayList<>();

        public DefaultEnemy(Pokemon attackingPokemon, Pokemon oppPokemon, int power, int accuracy, Action nextAction) {
            super(new Object[0]);
            this.pokemon = attackingPokemon;
            this.oppPokemon = oppPokemon;
            this.power = power;
            this.accuracy = accuracy;
            this.nextAction = nextAction;
            this.position = new Vector2(this.pokemon.sprite.getX(), this.pokemon.sprite.getY());
            this.positions.add(new Vector2(-8.0f, 0.0f));
            this.positions.add(new Vector2(8.0f, 0.0f));
            for (int i = 0; i < 13; i++) {
                this.positions.add(new Vector2(0.0f, 0.0f));
            }
            this.sprites = new ArrayList<>();
            for (int i2 = 0; i2 < 15; i2++) {
                this.sprites.add(null);
            }
            this.repeats = new ArrayList<>();
            this.repeats.add(7);
            this.repeats.add(3);
            this.repeats.add(17);
            this.repeats.add(6);
            this.repeats.add(7);
            this.repeats.add(5);
            this.repeats.add(9);
            this.repeats.add(4);
            this.repeats.add(8);
            this.repeats.add(6);
            this.repeats.add(7);
            this.repeats.add(5);
            this.repeats.add(9);
            this.repeats.add(4);
            this.repeats.add(11);
            this.alphas = new ArrayList<>();
            this.alphas.add(Float.valueOf(1.0f));
            this.alphas.add(Float.valueOf(1.0f));
            this.alphas.add(Float.valueOf(1.0f));
            for (int i3 = 0; i3 < 6; i3++) {
                this.alphas.add(Float.valueOf(0.0f));
                this.alphas.add(Float.valueOf(1.0f));
            }
            this.sounds = new ArrayList<>();
            this.sounds.add(null);
            this.sounds.add("tackle1");
            for (int i4 = 0; i4 < 13; i4++) {
                this.sounds.add(null);
            }
        }

        @Override // com.corona.game.Action
        public String getCamera() {
            return "gui";
        }

        @Override // com.corona.game.Action
        public Action.Layer getLayer() {
            return this.layer;
        }

        @Override // com.corona.game.Action
        public void step(Game game) {
            if (this.positions.isEmpty() || this.sprites.isEmpty()) {
                int finalHealth = this.oppPokemon.currentStats.get("hp").intValue() - this.power;
                if (finalHealth < 0) {
                    finalHealth = 0;
                }
                this.oppPokemon.currentStats.put("hp", Integer.valueOf(finalHealth));
                game.insertAction(this.nextAction);
                game.actionStack.remove(this);
                return;
            }
            this.sprite = this.sprites.get(0);
            this.oppPokemon.backSprite.setAlpha(this.alphas.get(0).floatValue());
            this.sound = this.sounds.get(0);
            if (this.sound != null) {
                game.insertAction(new PlayMusic(this.sound, (Action) null));
                this.sounds.set(0, null);
            }
            if (this.repeats.get(0).intValue() > 1) {
                this.repeats.set(0, Integer.valueOf(this.repeats.get(0).intValue() - 1));
                return;
            }
            this.position = this.position.add(this.positions.get(0));
            this.pokemon.sprite.setPosition(this.position.x, this.position.y);
            this.positions.remove(0);
            this.sprites.remove(0);
            this.repeats.remove(0);
            this.sounds.remove(0);
            this.alphas.remove(0);
        }
    }

    /* compiled from: Battle.java */
    /* access modifiers changed from: package-private */
    /* loaded from: pokewilds.jar:com/pkmngen/game/Attack$Lick.class */
    public static class Lick extends Action {
        ArrayList<Vector2> positions;
        Vector2 position;
        ArrayList<Vector2> screenPositions;
        Vector2 currPosition;
        ArrayList<Sprite> sprites;
        Sprite sprite;
        String sound;
        ArrayList<String> sounds;
        Sprite helperSprite;
        Pokemon attacker;
        Pokemon target;
        Pixmap pixmap;
        public Action.Layer layer = Action.Layer.gui_108;
        int power = 30;
        int accuracy = 100;
        Sprite blockSprite = new Sprite(TextureCache.get(Gdx.files.internal("battle/pixel1.png")), 0, 0, 1, 1);
        ArrayList<Integer> repeats = new ArrayList<>();

        public Lick(Game game, Pokemon attacker, Pokemon target, Action nextAction) {
            super(new Object[0]);
            this.attacker = attacker;
            this.target = target;
            this.nextAction = nextAction;
            this.repeats.add(18);
            this.repeats.add(12);
            for (int i = 0; i < 2; i++) {
                for (int j = 0; j < 2; j++) {
                    this.repeats.add(5);
                }
                this.repeats.add(6);
            }
            this.repeats.add(22);
            this.position = new Vector2(0.0f, 0.0f);
            this.positions = new ArrayList<>();
            for (int i2 = 0; i2 < 9; i2++) {
                this.positions.add(new Vector2(0.0f, 0.0f));
            }
            this.screenPositions = new ArrayList<>();
            for (int i3 = 0; i3 < 9; i3++) {
                this.screenPositions.add(new Vector2(0.0f, 0.0f));
            }
            for (int i4 = 0; i4 < 5; i4++) {
                this.screenPositions.add(new Vector2(2.0f, 0.0f));
            }
            for (int i5 = 0; i5 < 9; i5++) {
                this.screenPositions.add(new Vector2(0.0f, 0.0f));
            }
            for (int i6 = 0; i6 < 4; i6++) {
                this.screenPositions.add(new Vector2(1.0f, 0.0f));
            }
            for (int i7 = 0; i7 < 19; i7++) {
                this.screenPositions.add(new Vector2(0.0f, 0.0f));
            }
            Texture text = TextureCache.get(Gdx.files.internal("attacks/enemy_lick_sheet1.png"));
            this.sprites = new ArrayList<>();
            this.sprites.add(null);
            for (int i8 = 0; i8 < 7; i8++) {
                this.sprites.add(new Sprite(text, 160 * i8, 0, 160, 144));
            }
            this.sprites.add(null);
            this.sounds = new ArrayList<>();
            this.sounds.add("lick1");
            for (int i9 = 0; i9 < 7; i9++) {
                this.sounds.add(null);
            }
            this.sounds.add("hit_normal1");
        }

        @Override // com.corona.game.Action
        public String getCamera() {
            return "gui";
        }

        @Override // com.corona.game.Action
        public Action.Layer getLayer() {
            return this.layer;
        }

        @Override // com.corona.game.Action
        public void step(Game game) {
            if (!this.repeats.isEmpty()) {
                this.sound = this.sounds.get(0);
                if (this.sound != null) {
                    game.insertAction(new PlayMusic(this.sound, (Action) null));
                    this.sounds.set(0, null);
                }
                this.sprite = this.sprites.get(0);
                if (this.sprite != null) {
                    this.sprite.setPosition(this.position.x, this.position.y);
                    this.sprite.draw(game.uiBatch);
                }
                if (this.repeats.get(0).intValue() > 0) {
                    this.repeats.set(0, Integer.valueOf(this.repeats.get(0).intValue() - 1));
                    return;
                }
                this.position = this.position.add(this.positions.get(0));
                this.positions.remove(0);
                this.sprites.remove(0);
                this.repeats.remove(0);
                this.sounds.remove(0);
            } else if (!this.screenPositions.isEmpty()) {
                this.currPosition = this.screenPositions.get(0);
                this.pixmap = ScreenUtils.getFrameBufferPixmap(0, 0, 480, 432);
                for (int j = 0; j < 144; j++) {
                    for (int i = 0; i < 160; i++) {
                        this.blockSprite.setColor(new Color(this.pixmap.getPixel(i * 3, j * 3)));
                        this.blockSprite.setPosition(((float) i) + this.currPosition.x, ((float) j) + this.currPosition.y);
                        this.blockSprite.draw(game.uiBatch);
                    }
                }
                this.screenPositions.remove(0);
            } else {
                int finalHealth = this.target.currentStats.get("hp").intValue() - this.power;
                if (finalHealth < 0) {
                    finalHealth = 0;
                }
                this.target.currentStats.put("hp", Integer.valueOf(finalHealth));
                game.actionStack.remove(this);
                game.insertAction(this.nextAction);
            }
        }
    }

    /* compiled from: Battle.java */
    /* access modifiers changed from: package-private */
    /* loaded from: pokewilds.jar:com/pkmngen/game/Attack$Mewtwo_Special1.class */
    public static class Mewtwo_Special1 extends Action {
        Pokemon attacker;
        Pokemon target;
        int[] currOffsets;
        Vector2 currPosition;
        String currShaderVal;
        ShaderProgram currShader;
        public Action.Layer layer = Action.Layer.gui_109;
        int power = 100;
        int accuracy = 100;
        Pixmap pixmap = null;
        ArrayList<int[]> offsets = new ArrayList<>();
        ArrayList<Vector2> positions = new ArrayList<>();
        ArrayList<String> shaderVals = new ArrayList<>();
        boolean firstStep = true;
        boolean isNightShade = false;
        boolean hitSound = true;
        int timer = 0;
        Sprite sprite = new Sprite(TextureCache.get(Gdx.files.internal("battle/pixel1.png")), 0, 0, 1, 1);
        String vertexShader = "attribute vec4 a_position;\nattribute vec4 a_color;\nattribute vec2 a_texCoord;\nattribute vec2 a_texCoord0;\nuniform mat4 u_projTrans;\nvarying vec4 v_color;\nvarying vec2 v_texCoords;\nvoid main()\n{\n    v_color = a_color;\n    v_texCoords = a_texCoord0;\n    gl_Position =  u_projTrans * a_position;\n}\n";

        public Mewtwo_Special1(Game game, Pokemon attacker, Pokemon target, Action nextAction) {
            super(new Object[0]);
            this.target = target;
            this.attacker = attacker;
            this.nextAction = nextAction;
            String darken1 = getShader(-0.33f);
            String darken2 = getShader(-0.66f);
            String darken3 = getShader(-1.0f);
            String lighten1 = getShader(0.33f);
            String lighten2 = getShader(0.66f);
            String lighten3 = getShader(1.0f);
            String normal = getShader(0.0f);
            this.shaderVals.add(darken1);
            this.shaderVals.add(darken1);
            this.shaderVals.add(darken2);
            this.shaderVals.add(darken2);
            this.shaderVals.add(darken3);
            this.shaderVals.add(darken3);
            this.shaderVals.add(darken2);
            this.shaderVals.add(darken2);
            this.shaderVals.add(darken1);
            this.shaderVals.add(darken1);
            this.shaderVals.add(normal);
            this.shaderVals.add(normal);
            this.shaderVals.add(lighten1);
            this.shaderVals.add(lighten1);
            this.shaderVals.add(lighten2);
            this.shaderVals.add(lighten2);
            this.shaderVals.add(lighten3);
            this.shaderVals.add(lighten3);
            this.shaderVals.add(lighten2);
            this.shaderVals.add(lighten2);
            this.shaderVals.add(lighten1);
            this.shaderVals.add(lighten1);
            this.shaderVals.add(normal);
            this.shaderVals.add(normal);
            this.shaderVals.add(darken1);
            this.shaderVals.add(darken2);
            this.shaderVals.add(darken3);
            this.shaderVals.add(darken2);
            this.shaderVals.add(darken1);
            this.shaderVals.add(normal);
            this.shaderVals.add(lighten1);
            this.shaderVals.add(lighten2);
            this.shaderVals.add(lighten3);
            this.shaderVals.add(lighten2);
            this.shaderVals.add(lighten1);
            this.shaderVals.add(normal);
            this.shaderVals.add(darken1);
            this.shaderVals.add(darken2);
            this.shaderVals.add(darken3);
            this.shaderVals.add(darken2);
            this.shaderVals.add(darken1);
            this.shaderVals.add(normal);
            this.shaderVals.add(lighten1);
            this.shaderVals.add(lighten2);
            this.shaderVals.add(lighten3);
            this.shaderVals.add(lighten2);
            this.shaderVals.add(lighten1);
            for (int i = 0; i < 8; i++) {
                this.shaderVals.add(normal);
            }
            for (int i2 = 0; i2 < 9; i2++) {
                this.positions.add(new Vector2(0.0f, 0.0f));
            }
            for (int i3 = 0; i3 < 5; i3++) {
                this.positions.add(new Vector2(2.0f, 0.0f));
            }
            for (int i4 = 0; i4 < 9; i4++) {
                this.positions.add(new Vector2(0.0f, 0.0f));
            }
            for (int i5 = 0; i5 < 4; i5++) {
                this.positions.add(new Vector2(1.0f, 0.0f));
            }
            for (int i6 = 0; i6 < 19; i6++) {
                this.positions.add(new Vector2(0.0f, 0.0f));
            }
        }

        @Override // com.corona.game.Action
        public String getCamera() {
            return "gui";
        }

        @Override // com.corona.game.Action
        public Action.Layer getLayer() {
            return this.layer;
        }

        String getShader(float level) {
            return "#ifdef GL_ES\n    precision mediump float;\n#endif\n\nvarying vec4 v_color;\nvarying vec2 v_texCoords;\nuniform sampler2D u_texture;\n\nvoid main() {\n    vec4 color = texture2D (u_texture, v_texCoords) * v_color;\n    float level = " + level + ";\n    if (color.r >= .9 && color.g >= .9 && color.b >= .9) {\n           color = vec4(color.r, color.g, color.b, color.a);\n    }\n    else {\n        color = vec4(color.r-level, color.g-level, color.b-level, color.a);\n    }\n    gl_FragColor = color;\n}";
        }

        @Override // com.corona.game.Action
        public void step(Game game) {
            if (this.timer == 0) {
                this.currShader = new ShaderProgram(this.vertexShader, getShader(0.8f));
                game.uiBatch.setShader(this.currShader);
                SpecialBattleMewtwo.RocksEffect1.shouldMoveY = false;
                SpecialBattleMewtwo.RocksEffect2.shouldMoveY = false;
            } else if (this.timer >= 50) {
                if (this.timer == 60) {
                    game.insertAction(new PlayMusic("Mewtwo_Special1", (Action) null));
                    SpecialBattleMewtwo.RocksEffect1.velocityX = -8;
                    SpecialBattleMewtwo.RocksEffect2.velocityX = -2;
                    this.currShader = new ShaderProgram(this.vertexShader, getShader(0.6f));
                    game.uiBatch.setShader(this.currShader);
                } else if (this.timer == 120) {
                    SpecialBattleMewtwo.RocksEffect1.velocityX = -12;
                    SpecialBattleMewtwo.RocksEffect2.velocityX = -3;
                    this.currShader = new ShaderProgram(this.vertexShader, getShader(0.4f));
                    game.uiBatch.setShader(this.currShader);
                } else if (this.timer == 180) {
                    SpecialBattleMewtwo.RocksEffect1.velocityX = -16;
                    SpecialBattleMewtwo.RocksEffect2.velocityX = -4;
                    this.currShader = new ShaderProgram(this.vertexShader, getShader(0.2f));
                    game.uiBatch.setShader(this.currShader);
                } else if (this.timer == 190) {
                    this.currShader = new ShaderProgram(this.vertexShader, getShader(0.3f));
                    game.uiBatch.setShader(this.currShader);
                } else if (this.timer == 200) {
                    this.currShader = new ShaderProgram(this.vertexShader, getShader(0.0f));
                    game.uiBatch.setShader(this.currShader);
                } else if (this.timer == 210) {
                    this.currShader = new ShaderProgram(this.vertexShader, getShader(0.1f));
                    game.uiBatch.setShader(this.currShader);
                } else if (this.timer == 220) {
                    this.currShader = new ShaderProgram(this.vertexShader, getShader(-0.2f));
                    game.uiBatch.setShader(this.currShader);
                } else if (this.timer == 230) {
                    this.currShader = new ShaderProgram(this.vertexShader, getShader(-0.1f));
                    game.uiBatch.setShader(this.currShader);
                } else if (this.timer == 240) {
                    this.currShader = new ShaderProgram(this.vertexShader, getShader(-0.4f));
                    game.uiBatch.setShader(this.currShader);
                } else if (this.timer == 250) {
                    this.currShader = new ShaderProgram(this.vertexShader, getShader(-0.3f));
                    game.uiBatch.setShader(this.currShader);
                } else if (this.timer == 260) {
                    this.currShader = new ShaderProgram(this.vertexShader, getShader(-0.6f));
                    game.uiBatch.setShader(this.currShader);
                } else if (this.timer == 270) {
                    this.currShader = new ShaderProgram(this.vertexShader, getShader(-0.5f));
                    game.uiBatch.setShader(this.currShader);
                } else if (this.timer == 280) {
                    this.currShader = new ShaderProgram(this.vertexShader, getShader(-0.8f));
                    game.uiBatch.setShader(this.currShader);
                } else if (this.timer >= 300) {
                    if (this.timer < 550) {
                        if (this.timer % 2 == 0) {
                            game.player.currPokemon.backSprite.setAlpha(1.0f);
                        } else {
                            game.player.currPokemon.backSprite.setAlpha(0.0f);
                        }
                        if (this.timer == 340) {
                            this.currShader = new ShaderProgram(this.vertexShader, getShader(-0.6f));
                            game.uiBatch.setShader(this.currShader);
                        }
                        if (this.timer == 400) {
                            this.currShader = new ShaderProgram(this.vertexShader, getShader(-0.4f));
                            game.uiBatch.setShader(this.currShader);
                        }
                        if (this.timer == 460) {
                            this.currShader = new ShaderProgram(this.vertexShader, getShader(-0.2f));
                            game.uiBatch.setShader(this.currShader);
                        }
                        if (this.timer == 455) {
                            SpecialBattleMewtwo.RocksEffect1.velocityX = -14;
                            SpecialBattleMewtwo.RocksEffect2.velocityX = -3;
                        } else if (this.timer == 465) {
                            SpecialBattleMewtwo.RocksEffect1.velocityX = -12;
                        } else if (this.timer == 475) {
                            SpecialBattleMewtwo.RocksEffect1.velocityX = -10;
                        } else if (this.timer == 485) {
                            SpecialBattleMewtwo.RocksEffect1.velocityX = -8;
                            SpecialBattleMewtwo.RocksEffect2.velocityX = -2;
                        } else if (this.timer == 495) {
                            SpecialBattleMewtwo.RocksEffect1.velocityX = -6;
                        } else if (this.timer == 505) {
                            SpecialBattleMewtwo.RocksEffect1.velocityX = -6;
                        } else if (this.timer == 515) {
                            SpecialBattleMewtwo.RocksEffect1.velocityX = -4;
                            SpecialBattleMewtwo.RocksEffect2.velocityX = -1;
                        } else if (this.timer == 525) {
                            SpecialBattleMewtwo.RocksEffect1.velocityX = -2;
                        } else if (this.timer == 535) {
                            SpecialBattleMewtwo.RocksEffect1.velocityX = 0;
                            SpecialBattleMewtwo.RocksEffect2.velocityX = 0;
                        }
                    } else if (this.timer == 550) {
                        game.player.currPokemon.backSprite.setAlpha(1.0f);
                        this.currShader = new ShaderProgram(this.vertexShader, getShader(0.0f));
                        game.uiBatch.setShader(this.currShader);
                        SpecialBattleMewtwo.RocksEffect1.shouldMoveY = true;
                        SpecialBattleMewtwo.RocksEffect2.shouldMoveY = true;
                    } else if (this.timer >= 600) {
                        game.actionStack.remove(this);
                        game.insertAction(this.nextAction);
                    }
                }
            }
            this.timer++;
        }
    }

    /* compiled from: Battle.java */
    /* loaded from: pokewilds.jar:com/pkmngen/game/Attack$CrushGrip.class */
    static class CrushGrip extends Action {
        boolean drawFriendly;
        Music soundEffect;
        Music soundEffect2;
        Vector2 pos;
        public Action.Layer layer = Action.Layer.gui_109;
        public int timer = -40;
        Sprite sprite = new Sprite(TextureCache.get(Gdx.files.internal("attacks/crush_grip1.png")), 192, 0, 32, 32);
        Sprite sprite2 = new Sprite(TextureCache.get(Gdx.files.internal("attacks/crush_grip1.png")), 64, 0, 32, 32);

        public CrushGrip(Game game, Pokemon target, Action nextAction) {
            super(new Object[0]);
            this.drawFriendly = false;
            this.nextAction = nextAction;
            if (target == game.battle.oppPokemon) {
                this.pos = new Vector2(86.0f, 82.0f);
                this.drawFriendly = false;
                return;
            }
            this.pos = new Vector2(54.0f, 62.0f);
            this.drawFriendly = true;
        }

        @Override // com.corona.game.Action
        public String getCamera() {
            return "gui";
        }

        @Override // com.corona.game.Action
        public Action.Layer getLayer() {
            return this.layer;
        }

        @Override // com.corona.game.Action
        public void firstStep(Game game) {
            this.soundEffect = AudioLoader.loadMusic("attacks/rolling_kick_player_gsc/sound.ogg");
            this.soundEffect.setLooping(false);
            this.soundEffect.setVolume(1.0f);
            this.soundEffect2 = AudioLoader.loadMusic("attacks/rock_throw_player_gsc/sound.ogg");
            this.soundEffect2.setLooping(false);
            this.soundEffect2.setVolume(1.0f);
        }

        @Override // com.corona.game.Action
        public void step(Game game) {
            int offset = 0;
            if (this.timer >= -20) {
                if (this.timer < -10) {
                    int friendly = 1;
                    if (this.drawFriendly) {
                        friendly = -1;
                    }
                    this.pos.add((float) (2 * friendly), (float) (1 * friendly));
                } else if (this.timer >= 20) {
                    if (this.timer < 166) {
                        if (this.timer % 2 == 0) {
                            offset = 2;
                        } else {
                            offset = -2;
                        }
                        game.uiBatch.setTransformMatrix(new Matrix4(new Vector3((float) offset, 0.0f, 0.0f), new Quaternion(), new Vector3(1.0f, 1.0f, 1.0f)));
                    } else if (this.timer >= 206) {
                        if (this.timer < 260) {
                            SpriteProxy.inverseColors = true;
                        } else {
                            SpriteProxy.inverseColors = false;
                            this.soundEffect.stop();
                            this.soundEffect.dispose();
                            this.soundEffect2.stop();
                            this.soundEffect2.dispose();
                            DrawFriendlyHealth.shouldDraw = true;
                            DrawEnemyHealth.shouldDraw = true;
                            game.actionStack.remove(this);
                            game.insertAction(this.nextAction);
                        }
                    }
                }
            }
            if (this.timer >= 90) {
                if (this.timer < 98) {
                    game.uiBatch.draw(this.sprite2, (this.pos.x - ((float) offset)) - 8.0f, this.pos.y + 8.0f);
                } else if (this.timer >= 106) {
                    if (this.timer < 114) {
                        game.uiBatch.draw(this.sprite2, (this.pos.x - ((float) offset)) + 8.0f, this.pos.y + 8.0f);
                    } else if (this.timer >= 122) {
                        if (this.timer < 130) {
                            game.uiBatch.draw(this.sprite2, (this.pos.x - ((float) offset)) - 8.0f, this.pos.y - 8.0f);
                        } else if (this.timer >= 138 && this.timer < 146) {
                            game.uiBatch.draw(this.sprite2, (this.pos.x - ((float) offset)) + 8.0f, this.pos.y - 8.0f);
                        }
                    }
                }
            }
            if (this.timer == -20) {
                this.soundEffect.play();
            } else if (this.timer == 20) {
                this.soundEffect.stop();
                this.soundEffect.dispose();
                this.soundEffect2.play();
                this.sprite.setRegion(160, 0, 32, 32);
            } else if (this.timer == 70) {
                this.soundEffect2.pause();
            } else if (this.timer == 90) {
                this.soundEffect = AudioLoader.loadMusic("sounds/ap1.ogg");
                this.soundEffect.play();
            } else if (this.timer == 98) {
                this.sprite.setRegion(160, 0, 32, 32);
            } else if (this.timer == 106) {
                this.soundEffect.stop();
                this.soundEffect.play();
            } else if (this.timer == 114) {
                this.sprite.setRegion(160, 0, 32, 32);
            } else if (this.timer == 122) {
                this.soundEffect.stop();
                this.soundEffect.play();
            } else if (this.timer == 130) {
                this.sprite.setRegion(160, 0, 32, 32);
            } else if (this.timer == 138) {
                this.soundEffect.stop();
                this.soundEffect.play();
            } else if (this.timer == 166) {
                game.uiBatch.setTransformMatrix(new Matrix4(new Vector3(0.0f, 0.0f, 0.0f), new Quaternion(), new Vector3(1.0f, 1.0f, 1.0f)));
            } else if (this.timer == 206) {
                this.soundEffect2.play();
            }
            if (this.drawFriendly) {
                DrawEnemyHealth.shouldDraw = false;
            } else {
                DrawFriendlyHealth.shouldDraw = false;
            }
            game.uiBatch.draw(this.sprite, this.pos.x - ((float) offset), this.pos.y);
            this.timer++;
        }
    }

    /* compiled from: Battle.java */
    /* access modifiers changed from: package-private */
    /* loaded from: pokewilds.jar:com/pkmngen/game/Attack$Psychic.class */
    public static class Psychic extends Action {
        Pokemon target;
        int[] currOffsets;
        Vector2 currPosition;
        String currShaderVal;
        ShaderProgram currShader;
        boolean isNightShade;
        public Action.Layer layer = Action.Layer.gui_103;
        int power = 100;
        int accuracy = 100;
        Pixmap pixmap = null;
        ArrayList<int[]> offsets = new ArrayList<>();
        ArrayList<Vector2> positions = new ArrayList<>();
        ArrayList<String> shaderVals = new ArrayList<>();
        boolean firstStep = true;
        boolean hitSound = true;
        Sprite sprite = new Sprite(TextureCache.get(Gdx.files.internal("battle/pixel1.png")), 0, 0, 1, 1);

        public Psychic(Game game, Pokemon target, boolean isNightShade, Action nextAction) {
            super(new Object[0]);
            this.isNightShade = false;
            this.isNightShade = isNightShade;
            this.target = target;
            this.nextAction = nextAction;
            String darken1 = getShader(-0.33f);
            String darken2 = getShader(-0.66f);
            String darken3 = getShader(-1.0f);
            String lighten1 = getShader(0.33f);
            String lighten2 = getShader(0.66f);
            String lighten3 = getShader(1.0f);
            String normal = getShader(0.0f);
            this.shaderVals.add(darken1);
            this.shaderVals.add(darken1);
            this.shaderVals.add(darken2);
            this.shaderVals.add(darken2);
            this.shaderVals.add(darken3);
            this.shaderVals.add(darken3);
            this.shaderVals.add(darken2);
            this.shaderVals.add(darken2);
            this.shaderVals.add(darken1);
            this.shaderVals.add(darken1);
            this.shaderVals.add(normal);
            this.shaderVals.add(normal);
            this.shaderVals.add(lighten1);
            this.shaderVals.add(lighten1);
            this.shaderVals.add(lighten2);
            this.shaderVals.add(lighten2);
            this.shaderVals.add(lighten3);
            this.shaderVals.add(lighten3);
            this.shaderVals.add(lighten2);
            this.shaderVals.add(lighten2);
            this.shaderVals.add(lighten1);
            this.shaderVals.add(lighten1);
            this.shaderVals.add(normal);
            this.shaderVals.add(normal);
            this.shaderVals.add(darken1);
            this.shaderVals.add(darken2);
            this.shaderVals.add(darken3);
            this.shaderVals.add(darken2);
            this.shaderVals.add(darken1);
            this.shaderVals.add(normal);
            this.shaderVals.add(lighten1);
            this.shaderVals.add(lighten2);
            this.shaderVals.add(lighten3);
            this.shaderVals.add(lighten2);
            this.shaderVals.add(lighten1);
            this.shaderVals.add(normal);
            this.shaderVals.add(darken1);
            this.shaderVals.add(darken2);
            this.shaderVals.add(darken3);
            this.shaderVals.add(darken2);
            this.shaderVals.add(darken1);
            this.shaderVals.add(normal);
            this.shaderVals.add(lighten1);
            this.shaderVals.add(lighten2);
            this.shaderVals.add(lighten3);
            this.shaderVals.add(lighten2);
            this.shaderVals.add(lighten1);
            for (int i = 0; i < 8; i++) {
                this.shaderVals.add(normal);
            }
            for (int i2 = 0; i2 < 9; i2++) {
                this.positions.add(new Vector2(0.0f, 0.0f));
            }
            for (int i3 = 0; i3 < 5; i3++) {
                this.positions.add(new Vector2(2.0f, 0.0f));
            }
            for (int i4 = 0; i4 < 9; i4++) {
                this.positions.add(new Vector2(0.0f, 0.0f));
            }
            for (int i5 = 0; i5 < 4; i5++) {
                this.positions.add(new Vector2(1.0f, 0.0f));
            }
            for (int i6 = 0; i6 < 19; i6++) {
                this.positions.add(new Vector2(0.0f, 0.0f));
            }
            this.offsets.add(new int[]{2, 2, 1, 0, 0, 0, -1, -2, -2, -2, -1, 0, 0, 0, 1, 2});
            this.offsets.add(new int[]{2, 2, 1, 1, 0, 0, -1, -1, -2, -2, -1, -1, 0, 0, 1, 1});
            this.offsets.add(new int[]{1, 2, 2, 1, 1, 0, 0, -1, -1, -2, -2, -1, -1, 0, 0, 1});
            this.offsets.add(new int[]{1, 1, 2, 2, 1, 1, 0, 0, -1, -1, -2, -2, -1, -1, 0, 0});
            this.offsets.add(new int[]{0, 0, 1, 2, 2, 2, 1, 0, 0, 0, -1, -2, -2, -2, -1, 0});
            this.offsets.add(new int[]{0, 0, 0, 1, 2, 2, 2, 1, 0, 0, 0, -1, -2, -2, -2, -1});
            this.offsets.add(new int[]{-1, 0, 0, 1, 1, 2, 2, 1, 1, 0, 0, -1, -1, -2, -2, -1});
            this.offsets.add(new int[]{-2, -1, 0, 0, 0, 1, 2, 2, 2, 1, 0, 0, 0, -1, -2, -2});
            this.offsets.add(new int[]{2, 2, 1, 1, 0, 0, -1, -1, -2, -2, -1, -1, 0, 0, 1, 1});
            this.offsets.add(new int[]{-2, -2, -1, -1, 0, 0, 1, 1, 2, 2, 1, 1, 0, 0, -1, -1});
            this.offsets.add(new int[]{0, 1, 2, 2, 2, 1, 0, 0, 0, -1, -2, -2, -2, -1, 0, 0});
            this.offsets.add(new int[]{-1, -1, -2, -2, -1, -1, 0, 0, 1, 1, 2, 2, 1, 1, 0, 0});
            this.offsets.add(new int[]{0, 0, -1, -2, -2, -2, -1, 0, 0, 0, 1, 2, 2, 2, 1, 0});
            this.offsets.add(new int[]{0, 0, 0, -1, -2, -2, -2, -1, 0, 0, 0, 1, 2, 2, 2, 1});
            this.offsets.add(new int[]{-1, -1, -2, -2, -1, -1, 0, 0, 1, 1, 2, 2, 1, 1, 0, 0});
            this.offsets.add(new int[]{2, 1, 0, 0, 0, -1, -2, -2, -2, -1, 0, 0, 0, 1, 2, 2});
            this.offsets.add(new int[]{2, 2, 1, 0, 0, 0, -1, -2, -2, -2, -1, 0, 0, 0, 1, 2});
            this.offsets.add(new int[]{2, 2, 2, 1, 0, 0, 0, -1, -2, -2, -2, -1, 0, 0, 0, 1});
            this.offsets.add(new int[]{-1, -1, -2, -2, -1, -1, 0, 0, 1, 1, 2, 2, 1, 1, 0, 0});
            this.offsets.add(new int[]{0, 1, 2, 2, 2, 1, 0, 0, 0, -1, -2, -2, -2, -1, 0, 0});
            this.offsets.add(new int[]{0, 0, 1, 2, 2, 2, 1, 0, 0, 0, -1, -2, -2, -2, -1, 0});
            this.offsets.add(new int[]{0, 0, 1, 1, 2, 2, 1, 1, 0, 0, -1, -1, -2, -2, -1, -1});
            this.offsets.add(new int[]{-1, 0, 0, 1, 1, 2, 2, 1, 1, 0, 0, -1, -1, -2, -2, -1});
            this.offsets.add(new int[]{-1, 0, 0, 1, 1, 2, 2, 1, 1, 0, 0, -1, -1, -2, -2, -1});
            this.offsets.add(new int[]{-2, -1, -1, 0, 0, 1, 1, 2, 2, 1, 1, 0, 0, -1, -1, -2});
            this.offsets.add(new int[]{-2, -2, -1, -1, 0, 0, 1, 1, 2, 2, 1, 1, 0, 0, -1, -1});
            this.offsets.add(new int[]{1, 1, 2, 2, 1, 1, 0, 0, -1, -1, -2, -2, -1, -1, 0, 0});
            this.offsets.add(new int[]{-1, -1, -2, -2, -1, -1, 0, 0, 1, 1, 2, 2, 1, 1, 0, 0});
            this.offsets.add(new int[]{0, 0, 1, 1, 2, 2, 1, 1, 0, 0, -1, -1, -2, -2, -1, -1});
            this.offsets.add(new int[]{0, 0, 0, -1, -2, -2, -2, -1, 0, 0, 0, 1, 2, 2, 2, 1});
            this.offsets.add(new int[]{1, 0, 0, 0, -1, -2, -2, -2, -1, 0, 0, 0, 1, 2, 2, 2});
            this.offsets.add(new int[]{2, 1, 0, 0, 0, -1, -2, -2, -2, -1, 0, 0, 0, 1, 2, 2});
            this.offsets.add(new int[]{2, 2, 1, 0, 0, 0, -1, -2, -2, -2, -1, 0, 0, 0, 1, 2});
            this.offsets.add(new int[]{2, 2, 2, 1, 0, 0, 0, -1, -2, -2, -2, -1, 0, 0, 0, 1});
            this.offsets.add(new int[]{1, 2, 2, 2, 1, 0, 0, 0, -1, -2, -2, -2, -1, 0, 0, 0});
            this.offsets.add(new int[]{1, 1, 2, 2, 1, 1, 0, 0, -1, -1, -2, -2, -1, -1, 0, 0});
            this.offsets.add(new int[]{0, 0, 1, 2, 2, 2, 1, 0, 0, 0, -1, -2, -2, -2, -1, 0});
            this.offsets.add(new int[]{0, 0, 0, -1, -2, -2, -2, -1, 0, 0, 0, 1, 2, 2, 2, 1});
            this.offsets.add(new int[]{0, 0, 0, 1, 2, 2, 2, 1, 0, 0, 0, -1, -2, -2, -2, -1});
            this.offsets.add(new int[]{-1, -1, 0, 0, 1, 1, 2, 2, 1, 1, 0, 0, -1, -1, -2, -2});
            this.offsets.add(new int[]{-2, -1, 0, 0, 0, 1, 2, 2, 2, 1, 0, 0, 0, -1, -2, -2});
            this.offsets.add(new int[]{-2, -2, -1, -1, 0, 0, 1, 1, 2, 2, 1, 1, 0, 0, -1, -1});
            this.offsets.add(new int[]{-2, -2, -1, -1, 0, 0, 1, 1, 2, 2, 1, 1, 0, 0, -1, -1});
            this.offsets.add(new int[]{0, -1, -1, -2, -2, -1, -1, 0, 0, 1, 1, 2, 2, 1, 1, 0});
            this.offsets.add(new int[]{0, -1, -1, -2, -2, -1, -1, 0, 0, 1, 1, 2, 2, 1, 1, 0});
            this.offsets.add(new int[]{0, 0, -1, -1, -2, -2, -1, -1, 0, 0, 1, 1, 2, 2, 1, 1});
            this.offsets.add(new int[]{1, 1, 0, 0, -1, -1, -2, -2, -1, -1, 0, 0, 1, 1, 2, 2});
            this.offsets.add(new int[]{1, 2, 2, 1, 1, 0, 0, -1, -1, -2, -2, -1, -1, 0, 0, 1});
            this.offsets.add(new int[]{2, 2, 1, 1, 0, 0, -1, -1, -2, -2, -1, -1, 0, 0, 1, 1});
            this.offsets.add(new int[]{1, 2, 2, 1, 1, 0, 0, -1, -1, -2, -2, -1, -1, 0, 0, 1});
            this.offsets.add(new int[]{1, 2, 2, 2, 1, 0, 0, 0, -1, -2, -2, -2, -1, 0, 0, 0});
            this.offsets.add(new int[]{0, 1, 1, 2, 2, 1, 1, 0, 0, -1, -1, -2, -2, -1, -1, 0});
            this.offsets.add(new int[]{0, 0, 1, 1, 2, 2, 1, 1, 0, 0, -1, -1, -2, -2, -1, -1});
            this.offsets.add(new int[]{-1, 0, 0, 1, 1, 2, 2, 1, 1, 0, 0, -1, -1, -2, -2, -1});
            this.offsets.add(new int[]{-1, -1, 0, 0, 1, 1, 2, 2, 1, 1, 0, 0, -1, -1, -2, -2});
            this.offsets.add(new int[]{-2, -1, -1, 0, 0, 1, 1, 2, 2, 1, 1, 0, 0, -1, -1, -2});
            this.offsets.add(new int[]{-2, -1, -1, 0, 0, 1, 1, 2, 2, 1, 1, 0, 0, -1, -1, -2});
            this.offsets.add(new int[]{2, 2, 2, 1, 0, 0, 0, -1, -2, -2, -2, -1, 0, 0, 0, 1});
            this.offsets.add(new int[]{-1, -1, -2, -2, -1, -1, 0, 0, 1, 1, 2, 2, 1, 1, 0, 0});
            this.offsets.add(new int[]{0, -1, -1, -2, -2, -1, -1, 0, 0, 1, 1, 2, 2, 1, 1, 0});
            this.offsets.add(new int[]{0, 0, -1, -1, -2, -2, -1, -1, 0, 0, 1, 1, 2, 2, 1, 1});
            this.offsets.add(new int[]{1, 0, 0, -1, -1, -2, -2, -1, -1, 0, 0, 1, 1, 2, 2, 1});
            this.offsets.add(new int[]{0, 0, 0, -1, -2, -2, -2, -1, 0, 0, 0, 1, 2, 2, 2, 1});
            this.offsets.add(new int[]{2, 1, 1, 0, 0, -1, -1, -2, -2, -1, -1, 0, 0, 1, 1, 2});
            this.offsets.add(new int[]{2, 2, 1, 1, 0, 0, -1, -1, -2, -2, -1, -1, 0, 0, 1, 1});
            this.offsets.add(new int[]{1, 2, 2, 1, 1, 0, 0, -1, -1, -2, -2, -1, -1, 0, 0, 1});
            this.offsets.add(new int[]{1, 1, 2, 2, 1, 1, 0, 0, -1, -1, -2, -2, -1, -1, 0, 0});
            this.offsets.add(new int[]{1, 1, 0, 0, -1, -1, -2, -2, -1, -1, 0, 0, 1, 1, 2, 2});
            this.offsets.add(new int[]{0, 0, 1, 1, 2, 2, 1, 1, 0, 0, -1, -1, -2, -2, -1, -1});
            this.offsets.add(new int[]{-1, 0, 0, 1, 1, 2, 2, 1, 1, 0, 0, -1, -1, -2, -2, -1});
            this.offsets.add(new int[]{-1, -1, 0, 0, 1, 1, 2, 2, 1, 1, 0, 0, -1, -1, -2, -2});
            this.offsets.add(new int[]{-2, -1, -1, 0, 0, 1, 1, 2, 2, 1, 1, 0, 0, -1, -1, -2});
            this.offsets.add(new int[]{-2, -2, -1, -1, 0, 0, 1, 1, 2, 2, 1, 1, 0, 0, -1, -1});
            this.offsets.add(new int[]{-1, -2, -2, -1, -1, 0, 0, 1, 1, 2, 2, 1, 1, 0, 0, -1});
            this.offsets.add(new int[]{-1, -2, -2, -2, -1, 0, 0, 0, 1, 2, 2, 2, 1, 0, 0, 0});
            this.offsets.add(new int[]{0, -1, -1, -2, -2, -1, -1, 0, 0, 1, 1, 2, 2, 1, 1, 0});
            this.offsets.add(new int[]{0, 0, 1, 1, 2, 2, 1, 1, 0, 0, -1, -1, -2, -2, -1, -1});
            this.offsets.add(new int[]{0, 0, -1, -1, -2, -2, -1, -1, 0, 0, 1, 1, 2, 2, 1, 1});
            this.offsets.add(new int[]{1, 1, 0, 0, -1, -1, -2, -2, -1, -1, 0, 0, 1, 1, 2, 2});
            this.offsets.add(new int[]{1, 1, 0, 0, -1, -1, -2, -2, -1, -1, 0, 0, 1, 1, 2, 2});
            this.offsets.add(new int[]{2, 2, 1, 1, 0, 0, -1, -1, -2, -2, -1, -1, 0, 0, 1, 1});
            this.offsets.add(new int[]{2, 2, 2, 1, 0, 0, 0, -1, -2, -2, -2, -1, 0, 0, 0, 1});
            this.offsets.add(new int[]{1, 1, 2, 2, 1, 1, 0, 0, -1, -1, -2, -2, -1, -1, 0, 0});
            this.offsets.add(new int[]{1, 1, 2, 2, 1, 1, 0, 0, -1, -1, -2, -2, -1, -1, 0, 0});
            this.offsets.add(new int[]{0, 1, 1, 2, 2, 1, 1, 0, 0, -1, -1, -2, -2, -1, -1, 0});
            this.offsets.add(new int[]{-1, 0, 0, 1, 1, 2, 2, 1, 1, 0, 0, -1, -1, -2, -2, -1});
            this.offsets.add(new int[]{-2, -2, -1, -1, 0, 0, 1, 1, 2, 2, 1, 1, 0, 0, -1, -1});
            this.offsets.add(new int[]{-2, -1, -1, 0, 0, 1, 1, 2, 2, 1, 1, 0, 0, -1, -1, -2});
            this.offsets.add(new int[]{-2, -2, -1, -1, 0, 0, 1, 1, 2, 2, 1, 1, 0, 0, -1, -1});
            this.offsets.add(new int[]{-2, -2, -2, -1, 0, 0, 0, 1, 2, 2, 2, 1, 0, 0, 0, -1});
            this.offsets.add(new int[]{-1, -1, -2, -2, -1, -1, 0, 0, 1, 1, 2, 2, 1, 1, 0, 0});
            this.offsets.add(new int[]{0, -1, -1, -2, -2, -1, -1, 0, 0, 1, 1, 2, 2, 1, 1, 0});
            this.offsets.add(new int[]{0, 0, -1, -1, -2, -2, -1, -1, 0, 0, 1, 1, 2, 2, 1, 1});
            this.offsets.add(new int[]{1, 0, 0, -1, -1, -2, -2, -1, -1, 0, 0, 1, 1, 2, 2, 1});
            this.offsets.add(new int[]{1, 1, 0, 0, -1, -1, -2, -2, -1, -1, 0, 0, 1, 1, 2, 2});
            this.offsets.add(new int[]{1, 1, 0, 0, -1, -1, -2, -2, -1, -1, 0, 0, 1, 1, 2, 2});
            this.offsets.add(new int[]{-2, -2, -1, 0, 0, 0, 1, 2, 2, 2, 1, 0, 0, 0, -1, -2});
            this.offsets.add(new int[]{1, 2, 2, 1, 1, 0, 0, -1, -1, -2, -2, -1, -1, 0, 0, 1});
            this.offsets.add(new int[]{1, 1, 2, 2, 1, 1, 0, 0, -1, -1, -2, -2, -1, -1, 0, 0});
            this.offsets.add(new int[]{0, 1, 1, 2, 2, 1, 1, 0, 0, -1, -1, -2, -2, -1, -1, 0});
            this.offsets.add(new int[]{0, 0, 1, 1, 2, 2, 1, 1, 0, 0, -1, -1, -2, -2, -1, -1});
            this.offsets.add(new int[]{0, 0, 1, 2, 2, 2, 1, 0, 0, 0, -1, -2, -2, -2, -1, 0});
            this.offsets.add(new int[]{-1, -1, 0, 0, 1, 1, 2, 2, 1, 1, 0, 0, -1, -1, -2, -2});
            this.offsets.add(new int[]{-2, -1, -1, 0, 0, 1, 1, 2, 2, 1, 1, 0, 0, -1, -1, -2});
            this.offsets.add(new int[]{-2, -2, -1, -1, 0, 0, 1, 1, 2, 2, 1, 1, 0, 0, -1, -1});
            this.offsets.add(new int[]{-1, -2, -2, -1, -1, 0, 0, 1, 1, 2, 2, 1, 1, 0, 0, -1});
            this.offsets.add(new int[]{0, 0, 1, 1, 2, 2, 1, 1, 0, 0, -1, -1, -2, -2, -1, -1});
            this.offsets.add(new int[]{0, -1, -1, -2, -2, -1, -1, 0, 0, 1, 1, 2, 2, 1, 1, 0});
            this.offsets.add(new int[]{0, 0, -1, -1, -2, -2, -1, -1, 0, 0, 1, 1, 2, 2, 1, 1});
            this.offsets.add(new int[]{1, 0, 0, -1, -1, -2, -2, -1, -1, 0, 0, 1, 1, 2, 2, 1});
            this.offsets.add(new int[]{1, 1, 0, 0, -1, -1, -2, -2, -1, -1, 0, 0, 1, 1, 2, 2});
            this.offsets.add(new int[]{2, 1, 1, 0, 0, -1, -1, -2, -2, -1, -1, 0, 0, 1, 1, 2});
            this.offsets.add(new int[]{2, 2, 1, 1, 0, 0, -1, -1, -2, -2, -1, -1, 0, 0, 1, 1});
            this.offsets.add(new int[]{2, 2, 2, 1, 0, 0, 0, -1, -2, -2, -2, -1, 0, 0, 0, 1});
            this.offsets.add(new int[]{1, 1, 2, 2, 1, 1, 0, 0, -1, -1, -2, -2, -1, -1, 0, 0});
            this.offsets.add(new int[]{0, -1, -1, -2, -2, -1, -1, 0, 0, 1, 1, 2, 2, 1, 1, 0});
            this.offsets.add(new int[]{0, 1, 1, 2, 2, 1, 1, 0, 0, -1, -1, -2, -2, -1, -1, 0});
            this.offsets.add(new int[]{-1, 0, 0, 1, 1, 2, 2, 1, 1, 0, 0, -1, -1, -2, -2, -1});
            this.offsets.add(new int[]{-1, 0, 0, 1, 1, 2, 2, 1, 1, 0, 0, -1, -1, -2, -2, -1});
            this.offsets.add(new int[]{-2, -1, -1, 0, 0, 1, 1, 2, 2, 1, 1, 0, 0, -1, -1, -2});
            this.offsets.add(new int[]{-2, -2, -1, -1, 0, 0, 1, 1, 2, 2, 1, 1, 0, 0, -1, -1});
            this.offsets.add(new int[]{-1, -2, -2, -1, -1, 0, 0, 1, 1, 2, 2, 1, 1, 0, 0, -1});
            this.offsets.add(new int[]{-1, -2, -2, -1, -1, 0, 0, 1, 1, 2, 2, 1, 1, 0, 0, -1});
            this.offsets.add(new int[]{-1, -1, -2, -2, -1, -1, 0, 0, 1, 1, 2, 2, 1, 1, 0, 0});
            this.offsets.add(new int[]{0, 0, -1, -1, -2, -2, -1, -1, 0, 0, 1, 1, 2, 2, 1, 1});
            this.offsets.add(new int[]{-1, 0, 0, 1, 1, 2, 2, 1, 1, 0, 0, -1, -1, -2, -2, -1});
            this.offsets.add(new int[]{1, 1, 0, 0, -1, -1, -2, -2, -1, -1, 0, 0, 1, 1, 2, 2});
        }

        @Override // com.corona.game.Action
        public String getCamera() {
            return "gui";
        }

        @Override // com.corona.game.Action
        public Action.Layer getLayer() {
            return this.layer;
        }

        String getShader(float level) {
            return "#ifdef GL_ES\n    precision mediump float;\n#endif\n\nvarying vec4 v_color;\nvarying vec2 v_texCoords;\nuniform sampler2D u_texture;\n\nvoid main() {\n    vec4 color = texture2D (u_texture, v_texCoords) * v_color;\n    float level = " + level + ";\n    color = vec4(color.r+level, color.g+level, color.b+level, color.a);\n    gl_FragColor = color;\n}";
        }

        @Override // com.corona.game.Action
        public void step(Game game) {
            if (this.firstStep) {
                if (this.isNightShade) {
                    game.insertAction(new PlayMusic("night_shade1", (Action) null));
                } else {
                    game.insertAction(new PlayMusic("psychic1", (Action) null));
                }
                this.firstStep = false;
            }
            if (!this.shaderVals.isEmpty()) {
                this.currShaderVal = this.shaderVals.get(0);
                this.currShader = new ShaderProgram(EvolutionAnim.vertexShader, this.currShaderVal);
                game.uiBatch.setShader(this.currShader);
                this.shaderVals.remove(0);
            } else if (!this.offsets.isEmpty()) {
                this.currOffsets = this.offsets.get(0);
                float heightM = game.currScreen.y / 144.0f;
                if (this.pixmap == null) {
                    game.uiBatch.flush();
                    int offsetX = (int) ((game.currScreen.x - ((160.0f * game.currScreen.y) / 144.0f)) / 2.0f);
                    this.pixmap = ScreenUtils.getFrameBufferPixmap(offsetX, 0, ((int) game.currScreen.x) - (offsetX * 2), (int) game.currScreen.y);
                }
                for (int j = 0; j < 141; j++) {
                    for (int i = 0; i < 160; i++) {
                        this.sprite.setColor(new Color(this.pixmap.getPixel((int) (((float) i) * heightM), (int) (((float) j) * heightM))));
                        this.sprite.setPosition((float) (i + this.currOffsets[j % 16]), (float) j);
                        this.sprite.draw(game.uiBatch);
                    }
                }
                this.offsets.remove(0);
            } else {
                game.actionStack.remove(this);
                game.insertAction(this.nextAction);
            }
        }
    }

    /* compiled from: Battle.java */
    /* access modifiers changed from: package-private */
    /* loaded from: pokewilds.jar:com/pkmngen/game/Attack$ShadowClaw.class */
    public static class ShadowClaw extends Action {
        ArrayList<Vector2> screenPositions;
        Vector2 currPosition;
        ArrayList<Sprite> sprites;
        Sprite sprite;
        ArrayList<Integer> repeats;
        String sound;
        ArrayList<String> sounds;
        String currShaderVal;
        ShaderProgram currShader;
        String vertexShader;
        Sprite helperSprite;
        Pokemon attacker;
        Pokemon target;
        Pixmap pixmap;
        ArrayList<String> shaderVals = new ArrayList<>();
        public Action.Layer layer = Action.Layer.gui_100;
        int power = 70;
        int accuracy = 100;
        Sprite blockSprite = new Sprite(TextureCache.get(Gdx.files.internal("battle/pixel1.png")), 0, 0, 1, 1);
        Vector2 position = new Vector2(16.0f, 40.0f);
        ArrayList<Vector2> positions = new ArrayList<>();

        public ShadowClaw(Game game, Pokemon attacker, Pokemon target, Action nextAction) {
            super(new Object[0]);
            this.attacker = attacker;
            this.target = target;
            this.nextAction = nextAction;
            Texture text = TextureCache.get(Gdx.files.internal("attacks/enemy_slash_sheet1.png"));
            for (int i = 0; i < 7; i++) {
                this.positions.add(new Vector2(0.0f, 0.0f));
            }
            this.screenPositions = new ArrayList<>();
            for (int i2 = 0; i2 < 9; i2++) {
                this.screenPositions.add(new Vector2(0.0f, 0.0f));
            }
            for (int i3 = 0; i3 < 5; i3++) {
                this.screenPositions.add(new Vector2(2.0f, 0.0f));
            }
            for (int i4 = 0; i4 < 9; i4++) {
                this.screenPositions.add(new Vector2(0.0f, 0.0f));
            }
            for (int i5 = 0; i5 < 4; i5++) {
                this.screenPositions.add(new Vector2(1.0f, 0.0f));
            }
            for (int i6 = 0; i6 < 19; i6++) {
                this.screenPositions.add(new Vector2(0.0f, 0.0f));
            }
            this.sprites = new ArrayList<>();
            this.sprites.add(null);
            this.sprites.add(null);
            for (int i7 = 0; i7 < 4; i7++) {
                this.sprites.add(new Sprite(text, 48 * i7, 0, 48, 48));
            }
            this.sprites.add(null);
            this.repeats = new ArrayList<>();
            this.repeats.add(19);
            this.repeats.add(39);
            for (int i8 = 0; i8 < 4; i8++) {
                this.repeats.add(6);
            }
            this.repeats.add(5);
            this.sounds = new ArrayList<>();
            this.sounds.add(null);
            this.sounds.add(null);
            this.sounds.add("slash1");
            for (int i9 = 0; i9 < 4; i9++) {
                this.sounds.add(null);
            }
            this.vertexShader = "attribute vec4 a_position;\nattribute vec4 a_color;\nattribute vec2 a_texCoord;\nattribute vec2 a_texCoord0;\nuniform mat4 u_projTrans;\nvarying vec4 v_color;\nvarying vec2 v_texCoords;\nvoid main()\n{\n    v_color = a_color;\n    v_texCoords = a_texCoord0;\n    gl_Position =  u_projTrans * a_position;\n}\n";
            String normalShader = "precision mediump float;\nvarying vec4 v_color;\nvarying vec2 v_texCoords;\nuniform sampler2D u_texture;\nuniform mat4 u_projTrans;\nbool equals(float a, float b) {\n    return abs(a-b) < 0.0001;\n}\nvoid main() {\n    vec4 color = texture2D (u_texture, v_texCoords) * v_color;\n    float level = 0.0;\n    color = vec4(color.r+level, color.g+level, color.b+level, color.a);\n    gl_FragColor = color;\n}\n";
            this.shaderVals.add("precision mediump float;\nvarying vec4 v_color;\nvarying vec2 v_texCoords;\nuniform sampler2D u_texture;\nuniform mat4 u_projTrans;\nbool equals(float a, float b) {\n    return abs(a-b) < 0.0001;\n}\nvoid main() {\n    vec4 color = texture2D (u_texture, v_texCoords) * v_color;\n    color = vec4(1-color.r, 1-color.g, 1-color.b, color.a);\n    gl_FragColor = color;\n}\n");
            for (int i10 = 0; i10 < 5; i10++) {
                this.shaderVals.add("precision mediump float;\nvarying vec4 v_color;\nvarying vec2 v_texCoords;\nuniform sampler2D u_texture;\nuniform mat4 u_projTrans;\nbool equals(float a, float b) {\n    return abs(a-b) < 0.0001;\n}\nvoid main() {\n    vec4 color = texture2D (u_texture, v_texCoords) * v_color;\n    color = vec4(1-color.r, 1-color.g, 1-color.b, color.a);\n    gl_FragColor = color;\n}\n");
            }
            this.shaderVals.add(normalShader);
        }

        @Override // com.corona.game.Action
        public String getCamera() {
            return "gui";
        }

        @Override // com.corona.game.Action
        public Action.Layer getLayer() {
            return this.layer;
        }

        @Override // com.corona.game.Action
        public void step(Game game) {
            if (!this.repeats.isEmpty()) {
                this.sound = this.sounds.get(0);
                if (this.sound != null) {
                    game.insertAction(new PlayMusic(this.sound, (Action) null));
                    this.sounds.set(0, null);
                }
                this.sprite = this.sprites.get(0);
                if (this.sprite != null) {
                    this.sprite.setPosition(this.position.x, this.position.y);
                    this.sprite.draw(game.uiBatch);
                }
                if (this.repeats.get(0).intValue() > 0) {
                    this.repeats.set(0, Integer.valueOf(this.repeats.get(0).intValue() - 1));
                    return;
                }
                this.position = this.position.add(this.positions.get(0));
                this.positions.remove(0);
                this.sprites.remove(0);
                this.repeats.remove(0);
                this.sounds.remove(0);
                this.currShaderVal = this.shaderVals.get(0);
                this.currShader = new ShaderProgram(this.vertexShader, this.currShaderVal);
                game.uiBatch.setShader(this.currShader);
                this.shaderVals.remove(0);
            } else if (!this.screenPositions.isEmpty()) {
                this.currPosition = this.screenPositions.get(0);
                this.pixmap = ScreenUtils.getFrameBufferPixmap(0, 0, 480, 432);
                for (int j = 0; j < 144; j++) {
                    for (int i = 0; i < 160; i++) {
                        this.blockSprite.setColor(new Color(this.pixmap.getPixel(i * 3, j * 3)));
                        this.blockSprite.setPosition(((float) i) + this.currPosition.x, ((float) j) + this.currPosition.y);
                        this.blockSprite.draw(game.uiBatch);
                    }
                }
                this.screenPositions.remove(0);
            } else {
                game.actionStack.remove(this);
                game.insertAction(this.nextAction);
            }
        }
    }

    /* compiled from: Battle.java */
    /* access modifiers changed from: package-private */
    /* loaded from: pokewilds.jar:com/pkmngen/game/Attack$Slash.class */
    public static class Slash extends Action {
        ArrayList<Vector2> screenPositions;
        Vector2 currPosition;
        ArrayList<Sprite> sprites;
        Sprite sprite;
        ArrayList<Integer> repeats;
        String sound;
        ArrayList<String> sounds;
        Sprite helperSprite;
        Pokemon attacker;
        Pokemon target;
        Pixmap pixmap;
        public Action.Layer layer = Action.Layer.gui_108;
        int power = 70;
        int accuracy = 100;
        Sprite blockSprite = new Sprite(TextureCache.get(Gdx.files.internal("battle/pixel1.png")), 0, 0, 1, 1);
        Vector2 position = new Vector2(16.0f, 40.0f);
        ArrayList<Vector2> positions = new ArrayList<>();

        public Slash(Game game, Pokemon attacker, Pokemon target, Action nextAction) {
            super(new Object[0]);
            this.attacker = attacker;
            this.target = target;
            this.nextAction = nextAction;
            Texture text = TextureCache.get(Gdx.files.internal("attacks/enemy_slash_sheet1.png"));
            for (int i = 0; i < 6; i++) {
                this.positions.add(new Vector2(0.0f, 0.0f));
            }
            this.screenPositions = new ArrayList<>();
            for (int i2 = 0; i2 < 9; i2++) {
                this.screenPositions.add(new Vector2(0.0f, 0.0f));
            }
            for (int i3 = 0; i3 < 5; i3++) {
                this.screenPositions.add(new Vector2(2.0f, 0.0f));
            }
            for (int i4 = 0; i4 < 9; i4++) {
                this.screenPositions.add(new Vector2(0.0f, 0.0f));
            }
            for (int i5 = 0; i5 < 4; i5++) {
                this.screenPositions.add(new Vector2(1.0f, 0.0f));
            }
            for (int i6 = 0; i6 < 19; i6++) {
                this.screenPositions.add(new Vector2(0.0f, 0.0f));
            }
            this.sprites = new ArrayList<>();
            this.sprites.add(null);
            for (int i7 = 0; i7 < 4; i7++) {
                this.sprites.add(new Sprite(text, 48 * i7, 0, 48, 48));
            }
            this.sprites.add(null);
            this.repeats = new ArrayList<>();
            this.repeats.add(19);
            for (int i8 = 0; i8 < 4; i8++) {
                this.repeats.add(6);
            }
            this.repeats.add(5);
            this.sounds = new ArrayList<>();
            this.sounds.add("slash1");
            for (int i9 = 0; i9 < 5; i9++) {
                this.sounds.add(null);
            }
        }

        @Override // com.corona.game.Action
        public String getCamera() {
            return "gui";
        }

        @Override // com.corona.game.Action
        public Action.Layer getLayer() {
            return this.layer;
        }

        @Override // com.corona.game.Action
        public void step(Game game) {
            if (!this.repeats.isEmpty()) {
                this.sound = this.sounds.get(0);
                if (this.sound != null) {
                    game.insertAction(new PlayMusic(this.sound, (Action) null));
                    this.sounds.set(0, null);
                }
                this.sprite = this.sprites.get(0);
                if (this.sprite != null) {
                    this.sprite.setPosition(this.position.x, this.position.y);
                    this.sprite.draw(game.uiBatch);
                }
                if (this.repeats.get(0).intValue() > 0) {
                    this.repeats.set(0, Integer.valueOf(this.repeats.get(0).intValue() - 1));
                    return;
                }
                this.position = this.position.add(this.positions.get(0));
                this.positions.remove(0);
                this.sprites.remove(0);
                this.repeats.remove(0);
                this.sounds.remove(0);
            } else if (!this.screenPositions.isEmpty()) {
                this.currPosition = this.screenPositions.get(0);
                this.pixmap = ScreenUtils.getFrameBufferPixmap(0, 0, 480, 432);
                for (int j = 0; j < 144; j++) {
                    for (int i = 0; i < 160; i++) {
                        this.blockSprite.setColor(new Color(this.pixmap.getPixel(i * 3, j * 3)));
                        this.blockSprite.setPosition(((float) i) + this.currPosition.x, ((float) j) + this.currPosition.y);
                        this.blockSprite.draw(game.uiBatch);
                    }
                }
                this.screenPositions.remove(0);
            } else {
                int finalHealth = this.target.currentStats.get("hp").intValue() - this.power;
                if (finalHealth < 0) {
                    finalHealth = 0;
                }
                this.target.currentStats.put("hp", Integer.valueOf(finalHealth));
                game.actionStack.remove(this);
                game.insertAction(this.nextAction);
            }
        }
    }
}
